function getCity() {

    //获得选中的省的id
    var province = $("#bankProvinceCode").val();
    if (province == "" || province == "请选择") {
        $("#bankCityCode").empty();
        return;
    }
    $.ajax({
        url: GV.ctxPath + 'area/getCity',
        type: "POST",
        async: false,
        data: {
            "provinceCode": province
        },
        dataType: "json",
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        success: function (result) {
            if ($.trim(result.options) != "0") {
                $("#bankCityCode").empty();
                $("#bankCityCode").append($.trim(result.options));
            } else {
                MessageBox.alert("获取市失败,请重试!");
            }
        }
    });
}

function getCityNo() {

    //获得选中的省的id
    var province = $("#province").val();
    if (province == "" || province == "请选择") {
        $("#city").empty();
        return;
    }
    $.ajax({
        url: GV.ctxPath + 'area/getAreaInfo',
        type: "POST",
        async: false,
        data: {
            "parentCode": province
        },
        dataType: "json",
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        success: function (result) {
            if ($.trim(result.options) != "0") {
                $("#city").empty();
                $("#city").append($.trim(result.options));
            } else {
                MessageBox.alert("获取市失败,请重试!");
            }
        }
    });
    getCountyNo();
}


function getCountyNo() {

    //获得选中的省的id
    var city = $("#city").val();
    if (city == "" || city == "请选择") {
        $("#county").empty();
        return;
    }
    $.ajax({
        url: GV.ctxPath + 'area/getAreaInfo',
        type: "POST",
        async: false,
        data: {
            "parentCode": city
        },
        dataType: "json",
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        success: function (result) {
            if ($.trim(result.options) != "0") {
                $("#county").empty();
                $("#county").append($.trim(result.options));
            } else {
                MessageBox.alert("获取区/县失败,请重试!");
            }
        }
    });
}

function getClassOne() {
    //获得选中商户类型
    var merchantType = $("#merchantType").val();
    if (merchantType == "" || merchantType == "请选择") {
        $("#classOne").empty();
        return;
    }
    $.ajax({
        url: GV.ctxPath + 'merConfig/getClassOne',
        type: "POST",
        async: false,
        data: {
            "merchantType": merchantType
        },
        dataType: "json",
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        success: function (result) {
            if ($.trim(result.options) != "0") {
                $("#classOne").empty();
                $("#classOne").append($.trim(result.options));
            } else {
                MessageBox.alert("获取一级分类失败,请重试!");
            }
        }
    });
    getClassTwo();
}

function getClassTwo() {
    //获得选中的商户类型
    var merchantType = $("#merchantType").val();
    if (merchantType == "" || merchantType == "请选择") {
        $("#classTwo").empty();
        return;
    }
    var classOne = $("#classOne").val();
    if (classOne == "" || classOne == "请选择") {
        $("#classTwo").empty();
        return;
    }
    $.ajax({
        url: GV.ctxPath + 'merConfig/getClassTwo',
        type: "POST",
        async: false,
        data: {
            "merchantType":merchantType,
            "classOne":classOne
        },
        dataType: "json",
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        success: function (result) {
            if ($.trim(result.options) != "0") {
                $("#classTwo").empty();
                $("#classTwo").append($.trim(result.options));
            } else {
                MessageBox.alert("获取二级分类失败,请重试!");
            }
        }
    });
}